import request from '@/utils/request';

import {getEW} from "@/utils/utils";

export async function query({...resetParams}) {
  return request(`/issued_invoices`,{
    method:'GET',
    params:{
      ...resetParams,
      order_direction:'desc',
      company_ids:getEW(resetParams.company_ids),
    }
  });
}


export async function remove({id,...restParams}) {
  return request(`/issued_invoices/${id}`, {
    method: 'DELETE',
    data:{
      ...restParams,
    }
  });
}


export async function add(restParams) {
  return request(`/issued_invoices`, {
    method: 'POST',
    data: {
      ...restParams,
    },
  });
}

export async function edit({id,...restParams}) {
  return request(`/issued_invoices/${id}`, {
    method: 'PUT',
    data: {
      ...restParams,
    },
  });
}

